package com.sf.fy.uav.common.enums;

/**
 * @author LTQ
 * @version 1.0
 * @description TODO
 * @date 2021-04-13 15:45
 * @since 1.8
 */
public enum BillTypeEnum {
    /**
     *
     */
    INCOME("收入", 1), WITHDRAWAL("提现", 2);
    private String desc;
    private Integer value;

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    BillTypeEnum(String desc, Integer value) {
        this.desc = desc;
        this.value = value;
    }


    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (BillTypeEnum ele : values()) {
            if (ele.getValue().equals(value)) {
                return ele.getDesc();
            }
        }
        return null;
    }

    public static String getName(Integer value) {
        for (BillTypeEnum ele : values()) {
            if (ele.getValue().equals(value)) {
                return ele.name();
            }
        }
        return null;
    }
}
